<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    header("Location: /".env("PUBLIC_PREFIX"));
});

Route::middleware(['removePrefix'])->prefix(env("PUBLIC_PREFIX"))->group(function(){
    Route::get('/',"Webdisk\IO\LocalFile@getFileList");
    Route::fallback("Webdisk\IO\LocalFile@getFileList");
});

Route::middleware(['removePrefix'])->prefix(env("DOWNLOAD_PREFIX","download"))->group(function(){
    Route::fallback("Webdisk\IO\LocalFile@download");
});

Route::get('/test', 'Webdisk\IO\LocalFile@getRemoteFile');
